Migrate Country.flag() from deprecated flags.fmcdn.net to flagcdn.com; add overload#1857
Merged
Merged
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1857 +/- ##
============================================
+ Coverage 92.41% 92.52% +0.11%
- Complexity 3555 3561 +6
============================================
Files 345 345
Lines 7025 7037 +12
Branches 685 686 +1
============================================
+ Hits 6492 6511 +19
+ Misses 367 364 -3
+ Partials 166 162 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…n.com - add ImageFormat enum (PNG, WEBP, SVG, JPG) - add flag(String size, ImageFormat format) overload for full control over image size and format (fixed-width, fixed-height, icon, SVG) - replace instance field flagUrl with static final FLAG_BASE_URL - existing flag() behaviour unchanged (PNG, w580)
kingthorin
approved these changes
Jun 25, 2026
bodiam
approved these changes
Jun 25, 2026
Contributor
|
Thanks @spannm ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
flags.fmcdn.netis deprecated. The domain operator explicitly requests migrating toflagcdn.com:Changes
Country.javaflags.fmcdn.netbase URL withhttps://flagcdn.com/flagUrlbystatic final FLAG_BASE_URLImageFormatenum (JPG, PNG, SVG, WEBP)flag(String size, ImageFormat format)for full control over image size and formatCountryTest.javatestFlag()regex to match the new URL patterntestFlagWithSizeProducesValidUrl(@ValueSource) to verify URL structure for a number of sample sizestestFlagWithFormatProducesValidUrl(@EnumSource) - covers allImageFormatvaluesBackward Compatibility
flag()without arguments keeps the same behavior as before (PNG, width 580px).Only the CDN domain changes, so existing usages are unaffected.